package com.feng.nuike.huawei;

import java.util.Scanner;

/**
 * @author feng
 * @decrition
 * @date 2022/2/170:09
 */
public class HJ2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String in = scanner.nextLine();
        String ch = scanner.nextLine();
        int count = 0;
        in = in.toLowerCase();
        ch = ch.toLowerCase();
        char[] chars = in.toCharArray();
        for (char aChar : chars) {
            if (ch.equals(aChar + "")) {
                count++;
            }
        }
        System.out.println(count);
    }
}
